<template>
    <h1>登录页面</h1>
    <div>
        <p>默认账号是admin，密码是123456</p>
    账号：<input type="text" placeholder="请输入你的账号" v-model="account"><br />
    密码：<input type="password" placeholder="请输入你的密码" v-model="password"><br />
    <button @click="login">登录</button>
    </div>
</template>

<script>
export default {
    data(){
        return{
         account:"",
         password:""
        }
    },
    methods: {
        login() {
            if (this.account === 'admin' && this.password  === '123456') {
                alert("登录成功")
            } else {
                alert("账号或密码错误,请重新登陆")
                this.password='';
            }
        }
    }
}
</script>